﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CommonDto
{
    public abstract class BaseRequestDto
    {
        /// <summary>
        /// 调用的API接口名称
        /// </summary>
        public string Method { get; set; } = null!;
        /// <summary>
        /// 应用标识
        /// </summary>
        public string AppKey { get; set; } = null!;
        /// <summary>
        /// 访问令牌
        /// </summary>
        public string AccessToken { get; set; } = null!;
        /// <summary>
        /// Unix时间戳
        /// </summary>
        public string Timestamp { get; set; } = null!;
        /// <summary>
        /// API协议版本
        /// </summary>
        public string Version { get; set; } = null!;
        /// <summary>
        /// 签名
        /// </summary>
        public string Sign { get; set; } = null!;
        /// <summary>
        /// 签名算法
        /// </summary>
        public string SignMethod { get; set; } = null!;
    }

    public abstract class BaseRequestDto<TParam> : BaseRequestDto
    {
        /// <summary>
        /// 业务参数
        /// </summary>
        public TParam? Param { get; set; }
    }
}


/*
AppKey、AccessToken：鉴权
AppKey、AccessToken、Method：授权
Timestamp：防重放
Version：多版本共存，契约兼容
Sign、SignMethod：防篡改
*/
